From dd34296008c6b1bf6cc1411d92c55d80ebd5c690 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 20 Jan 2016 09:07:47 -0800 Subject: [PATCH] Update dependencies and Rust version Just a routine for niche bug fixes, linkage errors, perf improvements, etc. --- Cargo.lock | 137 +++++++++++------------ Cargo.toml | 8 +- src/bin/bench.rs | 2 +- src/bin/build.rs | 2 +- src/bin/cargo.rs | 2 +- src/bin/clean.rs | 2 +- src/bin/doc.rs | 2 +- src/bin/fetch.rs | 2 +- src/bin/generate_lockfile.rs | 2 +- src/bin/git_checkout.rs | 2 +- src/bin/help.rs | 2 +- src/bin/install.rs | 2 +- src/bin/locate_project.rs | 4 +- src/bin/login.rs | 2 +- src/bin/new.rs | 2 +- src/bin/owner.rs | 2 +- src/bin/package.rs | 2 +- src/bin/pkgid.rs | 2 +- src/bin/publish.rs | 2 +- src/bin/read_manifest.rs | 2 +- src/bin/run.rs | 2 +- src/bin/rustc.rs | 2 +- src/bin/rustdoc.rs | 2 +- src/bin/search.rs | 2 +- src/bin/test.rs | 2 +- src/bin/uninstall.rs | 2 +- src/bin/update.rs | 2 +- src/bin/verify_project.rs | 2 +- src/bin/version.rs | 2 +- src/bin/yank.rs | 2 +- src/cargo/core/shell.rs | 45 ++++---- src/cargo/ops/cargo_package.rs | 7 +- src/cargo/util/errors.rs | 8 +- tests/support/registry.rs | 17 ++- tests/test_cargo_compile.rs | 3 +- tests/test_cargo_compile_custom_build.rs | 5 +- tests/test_cargo_compile_git_deps.rs | 9 +- tests/test_cargo_compile_path_deps.rs | 5 +- tests/test_cargo_freshness.rs | 3 +- tests/test_cargo_package.rs | 12 +- tests/test_cargo_publish.rs | 7 +- tests/test_cargo_test.rs | 3 +- tests/test_shell.rs | 3 +- tests/tests.rs | 5 + 44 files changed, 168 insertions(+), 167 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e464a5ee..aab8edce0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,27 +5,27 @@ dependencies = [ "advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "bufstream 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "crates-io 0.1.0", - "crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.6.78 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "filetime 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "git2-curl 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "hamcrest 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)", @@ -71,36 +71,36 @@ dependencies = [ name = "crates-io" version = "0.1.0" dependencies = [ - "curl 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam" -version = "0.1.6" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "curl" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "curl-sys 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl-sys" -version = "0.1.29" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -109,7 +109,7 @@ name = "docopt" version = "0.6.78" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "regex 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -119,26 +119,26 @@ name = "env_logger" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "filetime" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "flate2" -version = "0.2.11" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -161,12 +161,12 @@ dependencies = [ [[package]] name = "git2" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -175,9 +175,9 @@ name = "git2-curl" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "curl 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -191,16 +191,7 @@ name = "hamcrest" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "kernel32-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -214,19 +205,19 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libgit2-sys" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cmake 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "libssh2-sys 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -244,9 +235,9 @@ version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cmake 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -258,16 +249,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -280,7 +271,7 @@ name = "memchr" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -289,12 +280,17 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "nom" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "num" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -307,17 +303,17 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -342,13 +338,13 @@ version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" -version = "0.1.44" +version = "0.1.48" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -368,8 +364,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "semver" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nom 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "strsim" @@ -378,11 +377,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tar" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "filetime 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -396,7 +395,7 @@ dependencies = [ [[package]] name = "term" -version = "0.2.14" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -409,7 +408,7 @@ version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/Cargo.toml b/Cargo.toml index 7ff0500ff..1ae1a7cf7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ path = "src/cargo/lib.rs" [dependencies] advapi32-sys = "0.1" crates-io = { path = "src/crates-io", version = "0.1" } -crossbeam = "0.1" +crossbeam = "0.2" curl = "0.2" docopt = "0.6" env_logger = "0.3" @@ -28,7 +28,7 @@ flate2 = "0.2" git2 = "0.3" git2-curl = "0.3" glob = "0.2" -kernel32-sys = "0.1" +kernel32-sys = "0.2" libc = "0.2" libgit2-sys = "0.3" log = "0.3" @@ -36,8 +36,8 @@ num_cpus = "0.2" regex = "0.1" rustc-serialize = "0.3" semver = "0.2.0" -tar = "0.3" -term = "0.2" +tar = "0.4" +term = "0.4" time = "0.1" toml = "0.1" url = "0.2" diff --git a/src/bin/bench.rs b/src/bin/bench.rs index 691f4e33a..96203de1a 100644 --- a/src/bin/bench.rs +++ b/src/bin/bench.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, CliError, Human, Config}; use cargo::util::important_paths::{find_root_manifest_for_wd}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_no_run: bool, flag_package: Vec, flag_jobs: Option, diff --git a/src/bin/build.rs b/src/bin/build.rs index 428eac4c4..be550f475 100644 --- a/src/bin/build.rs +++ b/src/bin/build.rs @@ -6,7 +6,7 @@ use cargo::util::important_paths::{find_root_manifest_for_wd}; use cargo::util::{CliResult, Config}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_package: Vec, flag_jobs: Option, flag_features: Vec, diff --git a/src/bin/cargo.rs b/src/bin/cargo.rs index 72db84d25..9eb719a5c 100644 --- a/src/bin/cargo.rs +++ b/src/bin/cargo.rs @@ -14,7 +14,7 @@ use cargo::execute_main_without_stdin; use cargo::util::{self, CliResult, lev_distance, Config, human, CargoResult}; #[derive(RustcDecodable)] -struct Flags { +pub struct Flags { flag_list: bool, flag_verbose: bool, flag_quiet: bool, diff --git a/src/bin/clean.rs b/src/bin/clean.rs index e4345f843..fa3ef0e50 100644 --- a/src/bin/clean.rs +++ b/src/bin/clean.rs @@ -5,7 +5,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::{find_root_manifest_for_wd}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_package: Vec, flag_target: Option, flag_manifest_path: Option, diff --git a/src/bin/doc.rs b/src/bin/doc.rs index 651b8c39f..4907575f2 100644 --- a/src/bin/doc.rs +++ b/src/bin/doc.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::{find_root_manifest_for_wd}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_target: Option, flag_features: Vec, flag_jobs: Option, diff --git a/src/bin/fetch.rs b/src/bin/fetch.rs index 96d2d9541..cd17ef9b5 100644 --- a/src/bin/fetch.rs +++ b/src/bin/fetch.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::find_root_manifest_for_wd; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_manifest_path: Option, flag_verbose: bool, flag_quiet: bool, diff --git a/src/bin/generate_lockfile.rs b/src/bin/generate_lockfile.rs index 5bf4950a1..197a2319a 100644 --- a/src/bin/generate_lockfile.rs +++ b/src/bin/generate_lockfile.rs @@ -5,7 +5,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::find_root_manifest_for_wd; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_manifest_path: Option, flag_verbose: bool, flag_quiet: bool, diff --git a/src/bin/git_checkout.rs b/src/bin/git_checkout.rs index 82daf4587..1aa13bc6e 100644 --- a/src/bin/git_checkout.rs +++ b/src/bin/git_checkout.rs @@ -3,7 +3,7 @@ use cargo::sources::git::{GitSource}; use cargo::util::{Config, CliResult, CliError, human, ToUrl}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_url: String, flag_reference: String, flag_verbose: bool, diff --git a/src/bin/help.rs b/src/bin/help.rs index f07a1cc66..8f104fcbc 100644 --- a/src/bin/help.rs +++ b/src/bin/help.rs @@ -1,7 +1,7 @@ use cargo::util::{CliResult, CliError, Config}; #[derive(RustcDecodable)] -struct Options; +pub struct Options; pub const USAGE: &'static str = " Get some help with a cargo command. diff --git a/src/bin/install.rs b/src/bin/install.rs index 141956179..02a812433 100644 --- a/src/bin/install.rs +++ b/src/bin/install.rs @@ -3,7 +3,7 @@ use cargo::core::{SourceId, GitReference}; use cargo::util::{CliResult, Config, ToUrl, human}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_jobs: Option, flag_features: Vec, flag_no_default_features: bool, diff --git a/src/bin/locate_project.rs b/src/bin/locate_project.rs index 005e60b5a..b6c7aa075 100644 --- a/src/bin/locate_project.rs +++ b/src/bin/locate_project.rs @@ -2,7 +2,7 @@ use cargo::util::{CliResult, CliError, human, ChainError, Config}; use cargo::util::important_paths::{find_root_manifest_for_wd}; #[derive(RustcDecodable)] -struct LocateProjectFlags { +pub struct LocateProjectFlags { flag_manifest_path: Option, } @@ -18,7 +18,7 @@ Options: "; #[derive(RustcEncodable)] -struct ProjectLocation { +pub struct ProjectLocation { root: String } diff --git a/src/bin/login.rs b/src/bin/login.rs index 2f60631d6..70ef64d8e 100644 --- a/src/bin/login.rs +++ b/src/bin/login.rs @@ -7,7 +7,7 @@ use cargo::sources::RegistrySource; use cargo::util::{CliResult, Config, human, ChainError}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_host: Option, arg_token: Option, flag_verbose: bool, diff --git a/src/bin/new.rs b/src/bin/new.rs index 5b0554af9..ba3921322 100644 --- a/src/bin/new.rs +++ b/src/bin/new.rs @@ -4,7 +4,7 @@ use cargo::ops; use cargo::util::{CliResult, Config}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_verbose: bool, flag_quiet: bool, flag_color: Option, diff --git a/src/bin/owner.rs b/src/bin/owner.rs index b40fc3f69..40d4e20b9 100644 --- a/src/bin/owner.rs +++ b/src/bin/owner.rs @@ -2,7 +2,7 @@ use cargo::ops; use cargo::util::{CliResult, Config}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { arg_crate: Option, flag_token: Option, flag_add: Option>, diff --git a/src/bin/package.rs b/src/bin/package.rs index f5f89c35f..c9bb161ef 100644 --- a/src/bin/package.rs +++ b/src/bin/package.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::find_root_manifest_for_wd; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_verbose: bool, flag_quiet: bool, flag_color: Option, diff --git a/src/bin/pkgid.rs b/src/bin/pkgid.rs index 6446e1587..7a88b2905 100644 --- a/src/bin/pkgid.rs +++ b/src/bin/pkgid.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::{find_root_manifest_for_wd}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_verbose: bool, flag_quiet: bool, flag_color: Option, diff --git a/src/bin/publish.rs b/src/bin/publish.rs index 246057cab..cf8f8f904 100644 --- a/src/bin/publish.rs +++ b/src/bin/publish.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::find_root_manifest_for_wd; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_host: Option, flag_token: Option, flag_manifest_path: Option, diff --git a/src/bin/read_manifest.rs b/src/bin/read_manifest.rs index 9e8d81e4b..141ebfff9 100644 --- a/src/bin/read_manifest.rs +++ b/src/bin/read_manifest.rs @@ -6,7 +6,7 @@ use cargo::util::important_paths::{find_root_manifest_for_wd}; use cargo::sources::{PathSource}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_manifest_path: Option, flag_color: Option, } diff --git a/src/bin/run.rs b/src/bin/run.rs index ddee42ccf..1926bbf21 100644 --- a/src/bin/run.rs +++ b/src/bin/run.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, CliError, Config, Human}; use cargo::util::important_paths::{find_root_manifest_for_wd}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_bin: Option, flag_example: Option, flag_jobs: Option, diff --git a/src/bin/rustc.rs b/src/bin/rustc.rs index 391e5f41f..3337ffcff 100644 --- a/src/bin/rustc.rs +++ b/src/bin/rustc.rs @@ -6,7 +6,7 @@ use cargo::util::important_paths::{find_root_manifest_for_wd}; use cargo::util::{CliResult, CliError, Config}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { arg_opts: Option>, flag_package: Option, flag_jobs: Option, diff --git a/src/bin/rustdoc.rs b/src/bin/rustdoc.rs index 01a8307c4..9949c24c1 100644 --- a/src/bin/rustdoc.rs +++ b/src/bin/rustdoc.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::{find_root_manifest_for_wd}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { arg_opts: Vec, flag_target: Option, flag_features: Vec, diff --git a/src/bin/search.rs b/src/bin/search.rs index 93133a8dc..e40d193c2 100644 --- a/src/bin/search.rs +++ b/src/bin/search.rs @@ -2,7 +2,7 @@ use cargo::ops; use cargo::util::{CliResult, Config}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_host: Option, flag_verbose: bool, flag_quiet: bool, diff --git a/src/bin/test.rs b/src/bin/test.rs index b919b52a5..08b13df76 100644 --- a/src/bin/test.rs +++ b/src/bin/test.rs @@ -3,7 +3,7 @@ use cargo::util::{CliResult, CliError, Human, Config}; use cargo::util::important_paths::{find_root_manifest_for_wd}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { arg_args: Vec, flag_features: Vec, flag_jobs: Option, diff --git a/src/bin/uninstall.rs b/src/bin/uninstall.rs index e78bf605f..5b4b345dd 100644 --- a/src/bin/uninstall.rs +++ b/src/bin/uninstall.rs @@ -2,7 +2,7 @@ use cargo::ops; use cargo::util::{CliResult, Config}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_bin: Vec, flag_root: Option, flag_verbose: bool, diff --git a/src/bin/update.rs b/src/bin/update.rs index 00866a2a8..1a718125a 100644 --- a/src/bin/update.rs +++ b/src/bin/update.rs @@ -5,7 +5,7 @@ use cargo::util::{CliResult, Config}; use cargo::util::important_paths::find_root_manifest_for_wd; #[derive(RustcDecodable)] -struct Options { +pub struct Options { flag_package: Vec, flag_aggressive: bool, flag_precise: Option, diff --git a/src/bin/verify_project.rs b/src/bin/verify_project.rs index 5cbd027f3..721b6eb7d 100644 --- a/src/bin/verify_project.rs +++ b/src/bin/verify_project.rs @@ -11,7 +11,7 @@ use toml; pub type Error = HashMap; #[derive(RustcDecodable)] -struct Flags { +pub struct Flags { flag_manifest_path: Option, flag_verbose: bool, flag_quiet: bool, diff --git a/src/bin/version.rs b/src/bin/version.rs index 87402f7cc..24ef5aea3 100644 --- a/src/bin/version.rs +++ b/src/bin/version.rs @@ -4,7 +4,7 @@ use cargo; use cargo::util::{CliResult, Config}; #[derive(RustcDecodable)] -struct Options; +pub struct Options; pub const USAGE: &'static str = " Show version information diff --git a/src/bin/yank.rs b/src/bin/yank.rs index f9812154b..feb2c73cc 100644 --- a/src/bin/yank.rs +++ b/src/bin/yank.rs @@ -2,7 +2,7 @@ use cargo::ops; use cargo::util::{CliResult, Config}; #[derive(RustcDecodable)] -struct Options { +pub struct Options { arg_crate: Option, flag_token: Option, flag_vers: Option, diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index 5a50a9886..14cc5f387 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -2,9 +2,8 @@ use std::fmt; use std::io::prelude::*; use std::io; -use term::Attr; use term::color::{Color, BLACK, RED, GREEN, YELLOW}; -use term::{Terminal, TerminfoTerminal, color}; +use term::{self, Terminal, TerminfoTerminal, color, Attr}; use self::AdequateTerminal::{NoColor, Colored}; use self::Verbosity::{Verbose, Normal, Quiet}; @@ -61,14 +60,15 @@ impl MultiShell { &mut self.err } - pub fn say(&mut self, message: T, color: Color) -> io::Result<()> { + pub fn say(&mut self, message: T, color: Color) + -> CargoResult<()> { match self.verbosity { Quiet => Ok(()), _ => self.out().say(message, color) } } - pub fn status(&mut self, status: T, message: U) -> io::Result<()> + pub fn status(&mut self, status: T, message: U) -> CargoResult<()> where T: fmt::Display, U: fmt::Display { match self.verbosity { @@ -77,8 +77,8 @@ impl MultiShell { } } - pub fn verbose(&mut self, mut callback: F) -> io::Result<()> - where F: FnMut(&mut MultiShell) -> io::Result<()> + pub fn verbose(&mut self, mut callback: F) -> CargoResult<()> + where F: FnMut(&mut MultiShell) -> CargoResult<()> { match self.verbosity { Verbose => callback(self), @@ -86,8 +86,8 @@ impl MultiShell { } } - pub fn concise(&mut self, mut callback: F) -> io::Result<()> - where F: FnMut(&mut MultiShell) -> io::Result<()> + pub fn concise(&mut self, mut callback: F) -> CargoResult<()> + where F: FnMut(&mut MultiShell) -> CargoResult<()> { match self.verbosity { Verbose => Ok(()), @@ -95,11 +95,11 @@ impl MultiShell { } } - pub fn error(&mut self, message: T) -> io::Result<()> { + pub fn error(&mut self, message: T) -> CargoResult<()> { self.err().say(message, RED) } - pub fn warn(&mut self, message: T) -> io::Result<()> { + pub fn warn(&mut self, message: T) -> CargoResult<()> { self.err().say(message, YELLOW) } @@ -170,7 +170,7 @@ impl Shell { self.config.color_config = color_config; } - pub fn say(&mut self, message: T, color: Color) -> io::Result<()> { + pub fn say(&mut self, message: T, color: Color) -> CargoResult<()> { try!(self.reset()); if color != BLACK { try!(self.fg(color)); } try!(write!(self, "{}\n", message.to_string())); @@ -180,7 +180,7 @@ impl Shell { } pub fn say_status(&mut self, status: T, message: U, color: Color) - -> io::Result<()> + -> CargoResult<()> where T: fmt::Display, U: fmt::Display { try!(self.reset()); @@ -193,22 +193,24 @@ impl Shell { Ok(()) } - fn fg(&mut self, color: color::Color) -> io::Result { + fn fg(&mut self, color: color::Color) -> CargoResult { let colored = self.colored(); match self.terminal { - Colored(ref mut c) if colored => c.fg(color), - _ => Ok(false) + Colored(ref mut c) if colored => try!(c.fg(color)), + _ => return Ok(false), } + Ok(true) } - fn attr(&mut self, attr: Attr) -> io::Result { + fn attr(&mut self, attr: Attr) -> CargoResult { let colored = self.colored(); match self.terminal { - Colored(ref mut c) if colored => c.attr(attr), - _ => Ok(false) + Colored(ref mut c) if colored => try!(c.attr(attr)), + _ => return Ok(false) } + Ok(true) } fn supports_attr(&self, attr: Attr) -> bool { @@ -220,13 +222,14 @@ impl Shell { } } - fn reset(&mut self) -> io::Result<()> { + fn reset(&mut self) -> term::Result<()> { let colored = self.colored(); match self.terminal { - Colored(ref mut c) if colored => c.reset().map(|_| ()), - _ => Ok(()) + Colored(ref mut c) if colored => try!(c.reset()), + _ => () } + Ok(()) } fn colored(&self) -> bool { diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index 06897c2a7..7a2ad7ab5 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -2,7 +2,7 @@ use std::io::prelude::*; use std::fs::{self, File}; use std::path::{self, Path, PathBuf}; -use tar::Archive; +use tar::{Archive, Builder}; use flate2::{GzBuilder, Compression}; use flate2::read::GzDecoder; @@ -119,7 +119,7 @@ fn tar(pkg: &Package, .write(tmpfile, Compression::Best); // Put all package files into a compressed archive - let ar = Archive::new(encoder); + let mut ar = Builder::new(encoder); let root = pkg.root(); for file in try!(src.list_files(pkg)).iter() { if &**file == dst { continue } @@ -139,7 +139,8 @@ fn tar(pkg: &Package, internal(format!("could not archive source file `{}`", relative)) })); } - try!(ar.finish()); + let encoder = try!(ar.into_inner()); + try!(encoder.finish()); Ok(()) } diff --git a/src/cargo/util/errors.rs b/src/cargo/util/errors.rs index fbe1630d1..94499a9ba 100644 --- a/src/cargo/util/errors.rs +++ b/src/cargo/util/errors.rs @@ -5,11 +5,11 @@ use std::io; use std::process::{Output, ExitStatus}; use std::str; -use semver; -use rustc_serialize::json; - use curl; use git2; +use rustc_serialize::json; +use semver; +use term; use toml; use url; @@ -308,6 +308,7 @@ from_error! { url::ParseError, toml::DecodeError, ffi::NulError, + term::Error, } impl From> for Box { @@ -327,6 +328,7 @@ impl CargoError for toml::Error {} impl CargoError for toml::DecodeError {} impl CargoError for url::ParseError {} impl CargoError for ffi::NulError {} +impl CargoError for term::Error {} // ============================================================================= // Construction helpers diff --git a/tests/support/registry.rs b/tests/support/registry.rs index 2d4910edf..63f053245 100644 --- a/tests/support/registry.rs +++ b/tests/support/registry.rs @@ -6,7 +6,7 @@ use flate2::Compression::Default; use flate2::write::GzEncoder; use git2; use rustc_serialize::hex::ToHex; -use tar::{Archive, Header}; +use tar::{Builder, Header}; use url::Url; use support::paths; @@ -155,25 +155,24 @@ impl Package { let dst = self.archive_dst(); fs::create_dir_all(dst.parent().unwrap()).unwrap(); let f = File::create(&dst).unwrap(); - let a = Archive::new(GzEncoder::new(f, Default)); - self.append(&a, "Cargo.toml", &manifest); + let mut a = Builder::new(GzEncoder::new(f, Default)); + self.append(&mut a, "Cargo.toml", &manifest); if self.files.is_empty() { - self.append(&a, "src/lib.rs", ""); + self.append(&mut a, "src/lib.rs", ""); } else { for &(ref name, ref contents) in self.files.iter() { - self.append(&a, name, contents); + self.append(&mut a, name, contents); } } - a.finish().unwrap(); } - fn append(&self, ar: &Archive, file: &str, contents: &str) { - let mut header = Header::new(); + fn append(&self, ar: &mut Builder, file: &str, contents: &str) { + let mut header = Header::new_ustar(); header.set_size(contents.len() as u64); header.set_path(format!("{}-{}/{}", self.name, self.vers, file)).unwrap(); header.set_cksum(); - ar.append(&header, &mut contents.as_bytes()).unwrap(); + ar.append(&header, contents.as_bytes()).unwrap(); } pub fn archive_dst(&self) -> PathBuf { diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index 288c44d86..2460a7b27 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -1,7 +1,6 @@ use std::env; use std::fs::{self, File}; use std::io::prelude::*; -use std::thread; use tempdir::TempDir; use support::{project, execs, main_file, basic_bin_manifest}; @@ -1648,7 +1647,7 @@ test!(compile_then_delete { assert_that(&p.bin("foo"), existing_file()); if cfg!(windows) { // On windows unlinking immediately after running often fails, so sleep - thread::sleep_ms(100); + ::sleep_ms(100); } fs::remove_file(&p.bin("foo")).unwrap(); assert_that(p.cargo("run"), diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index 8c7357436..4778135dd 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -1,6 +1,5 @@ use std::fs::{self, File}; use std::io::prelude::*; -use std::thread; use support::{project, execs}; use support::{COMPILING, RUNNING, DOCTEST, FRESH, DOCUMENTING}; @@ -1739,7 +1738,7 @@ test!(rebuild_only_on_explicit_paths { {running} `rustc src[..]lib.rs [..]` ", running = RUNNING, compiling = COMPILING))); - thread::sleep_ms(1000); + ::sleep_ms(1000); File::create(p.root().join("foo")).unwrap(); File::create(p.root().join("bar")).unwrap(); @@ -1758,7 +1757,7 @@ test!(rebuild_only_on_explicit_paths { {fresh} a v0.5.0 ([..]) ", fresh = FRESH))); - thread::sleep_ms(1000); + ::sleep_ms(1000); // random other files do not affect freshness println!("run baz"); diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs index fe8cab182..57c3c16ca 100644 --- a/tests/test_cargo_compile_git_deps.rs +++ b/tests/test_cargo_compile_git_deps.rs @@ -1,7 +1,6 @@ use std::fs::{self, File}; use std::io::prelude::*; use std::path::Path; -use std::thread; use git2; use support::{git, project, execs, main_file, path2url}; @@ -638,7 +637,7 @@ test!(update_with_shared_deps { git::add(&repo); git::commit(&repo); - thread::sleep_ms(1000); + ::sleep_ms(1000); // By default, not transitive updates println!("dep1 update"); @@ -848,7 +847,7 @@ test!(stale_cached_version { git::add(&repo); git::commit(&repo); - thread::sleep_ms(1000); + ::sleep_ms(1000); let rev = repo.revparse_single("HEAD").unwrap().id(); @@ -955,7 +954,7 @@ test!(dep_with_changed_submodule { git::add(&repo); git::commit(&repo); - thread::sleep_ms(1000); + ::sleep_ms(1000); // Update the dependency and carry on! println!("update"); assert_that(project.cargo("update").arg("-v"), @@ -1056,7 +1055,7 @@ test!(git_build_cmd_freshness { }).unwrap(); foo.root().move_into_the_past().unwrap(); - thread::sleep_ms(1000); + ::sleep_ms(1000); assert_that(foo.cargo("build"), execs().with_status(0) diff --git a/tests/test_cargo_compile_path_deps.rs b/tests/test_cargo_compile_path_deps.rs index 319ec6e0c..a3e40acbe 100644 --- a/tests/test_cargo_compile_path_deps.rs +++ b/tests/test_cargo_compile_path_deps.rs @@ -1,6 +1,5 @@ use std::fs::{self, File}; use std::io::prelude::*; -use std::thread; use support::{project, execs, main_file}; use support::{COMPILING, RUNNING}; @@ -351,7 +350,7 @@ test!(deep_dependencies_trigger_rebuild { // // We base recompilation off mtime, so sleep for at least a second to ensure // that this write will change the mtime. - thread::sleep_ms(1000); + ::sleep_ms(1000); File::create(&p.root().join("baz/src/baz.rs")).unwrap().write_all(br#" pub fn baz() { println!("hello!"); } "#).unwrap(); @@ -364,7 +363,7 @@ test!(deep_dependencies_trigger_rebuild { COMPILING, p.url()))); // Make sure an update to bar doesn't trigger baz - thread::sleep_ms(1000); + ::sleep_ms(1000); File::create(&p.root().join("bar/src/bar.rs")).unwrap().write_all(br#" extern crate baz; pub fn bar() { println!("hello!"); baz::baz(); } diff --git a/tests/test_cargo_freshness.rs b/tests/test_cargo_freshness.rs index b6801be11..152190cf0 100644 --- a/tests/test_cargo_freshness.rs +++ b/tests/test_cargo_freshness.rs @@ -1,6 +1,5 @@ use std::fs::{self, File}; use std::io::prelude::*; -use std::thread; use support::{project, execs, path2url}; use support::COMPILING; @@ -67,7 +66,7 @@ test!(modify_only_some_files { ", compiling = COMPILING, dir = path2url(p.root())))); assert_that(p.cargo("test"), execs().with_status(0)); - thread::sleep_ms(1000); + ::sleep_ms(1000); assert_that(&p.bin("foo"), existing_file()); diff --git a/tests/test_cargo_package.rs b/tests/test_cargo_package.rs index f7ad7d150..2cea29350 100644 --- a/tests/test_cargo_package.rs +++ b/tests/test_cargo_package.rs @@ -1,5 +1,4 @@ use std::fs::File; -use std::io::Cursor; use std::io::prelude::*; use std::path::Path; @@ -8,8 +7,7 @@ use git2; use tar::Archive; use support::{project, execs, paths, git, path2url}; -use support::{PACKAGING, VERIFYING, COMPILING, ARCHIVING, UPDATING, DOWNLOADING}; -use support::registry::{self, Package}; +use support::{PACKAGING, VERIFYING, COMPILING, ARCHIVING}; use hamcrest::{assert_that, existing_file}; fn setup() { @@ -54,8 +52,8 @@ src[..]main.rs let mut rdr = GzDecoder::new(f).unwrap(); let mut contents = Vec::new(); rdr.read_to_end(&mut contents).unwrap(); - let ar = Archive::new(Cursor::new(contents)); - for f in ar.files().unwrap() { + let mut ar = Archive::new(&contents[..]); + for f in ar.entries().unwrap() { let f = f.unwrap(); let fname = f.header().path_bytes(); let fname = &*fname; @@ -387,8 +385,8 @@ src[..]main.rs let mut rdr = GzDecoder::new(f).unwrap(); let mut contents = Vec::new(); rdr.read_to_end(&mut contents).unwrap(); - let ar = Archive::new(Cursor::new(contents)); - for f in ar.files().unwrap() { + let mut ar = Archive::new(&contents[..]); + for f in ar.entries().unwrap() { let f = f.unwrap(); let fname = f.header().path_bytes(); let fname = &*fname; diff --git a/tests/test_cargo_publish.rs b/tests/test_cargo_publish.rs index 5e35c482a..a30a63f8d 100644 --- a/tests/test_cargo_publish.rs +++ b/tests/test_cargo_publish.rs @@ -1,6 +1,6 @@ use std::io::prelude::*; use std::fs::{self, File}; -use std::io::{Cursor, SeekFrom}; +use std::io::SeekFrom; use std::path::PathBuf; use flate2::read::GzDecoder; @@ -76,9 +76,8 @@ test!(simple { assert_eq!(rdr.header().filename().unwrap(), "foo-0.0.1.crate".as_bytes()); let mut contents = Vec::new(); rdr.read_to_end(&mut contents).unwrap(); - let inner = Cursor::new(contents); - let ar = Archive::new(inner); - for file in ar.files().unwrap() { + let mut ar = Archive::new(&contents[..]); + for file in ar.entries().unwrap() { let file = file.unwrap(); let fname = file.header().path_bytes(); let fname = &*fname; diff --git a/tests/test_cargo_test.rs b/tests/test_cargo_test.rs index 94213c3a1..5238faaca 100644 --- a/tests/test_cargo_test.rs +++ b/tests/test_cargo_test.rs @@ -1,7 +1,6 @@ use std::fs::File; use std::io::prelude::*; use std::str; -use std::thread; use support::{project, execs, basic_bin_manifest, basic_lib_manifest}; use support::{COMPILING, RUNNING, DOCTEST}; @@ -2009,7 +2008,7 @@ test!(bin_does_not_rebuild_tests { assert_that(p.cargo("test").arg("-v"), execs().with_status(0)); - thread::sleep_ms(1000); + ::sleep_ms(1000); File::create(&p.root().join("src/main.rs")).unwrap() .write_all(b"fn main() { 3; }").unwrap(); diff --git a/tests/test_shell.rs b/tests/test_shell.rs index 8d74c3aa2..931c7b818 100644 --- a/tests/test_shell.rs +++ b/tests/test_shell.rs @@ -6,6 +6,7 @@ use hamcrest::{assert_that}; use cargo::core::shell::{Shell, ShellConfig}; use cargo::core::shell::ColorConfig::{Auto,Always, Never}; +use cargo::util::CargoResult; use support::{Tap, execs, shell_writes}; @@ -84,7 +85,7 @@ test!(no_term { execs().with_stderr("")); }); -fn colored_output(string: &str, color: color::Color) -> io::Result { +fn colored_output(string: &str, color: color::Color) -> CargoResult { let mut term = TerminfoTerminal::new(Vec::new()).unwrap(); try!(term.reset()); try!(term.fg(color)); diff --git a/tests/tests.rs b/tests/tests.rs index 761fee61b..d0fd5d58b 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -96,3 +96,8 @@ fn process>(t: T) -> cargo::util::ProcessBuilder { fn cargo_process() -> cargo::util::ProcessBuilder { process(&support::cargo_dir().join("cargo")) } + +#[allow(deprecated)] // sleep_ms is now deprecated in favor of sleep() +fn sleep_ms(ms: u32) { + std::thread::sleep_ms(ms); +} -- 2.30.2